/*
 * SteepTimer - A timer designed for tea fanatics
 * Copyright (C) 2011  Wesley Crossman
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef TEAOPTIONSDIALOG_H
#define TEAOPTIONSDIALOG_H

#include "TeaIcon.h"
#include "TeaSound.h"
#include <QDialog>
#include <QPixmap>

namespace Ui {
    class TeaOptionsDialog;
}

namespace Phonon {
    class MediaObject;
    class AudioOutput;
}

class QTimer;

class TeaOptionsDialog : public QDialog
{
    Q_OBJECT

public:
    explicit TeaOptionsDialog(QWidget *parent = 0);
    ~TeaOptionsDialog();
    void saveSettings();

private:
    Ui::TeaOptionsDialog *m_ui;
    Phonon::MediaObject *m_mediaObject;
    Phonon::AudioOutput *m_audioOutput;
    bool m_mute;
    TeaIconSettings m_previewSettings;
    QPixmap m_previewRunning, m_previewOff;
    bool m_isPreviewRunning;
    QTimer *m_previewTimer;
    void loadSettings();

private slots:
    void play(int index=-1);
    void updatePreview();
    void vesselChanged();
    void previewTimerTimeout();
    void stateChanged(Phonon::State newstate, Phonon::State oldstate);
    void on_cmbAlarmSound_currentIndexChanged(int);
};

#endif // TEAOPTIONSDIALOG_H
